<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="jquery-1.11.3.min.js"></script>
    <style>
        .checkbox {
    position: relative;
    height: 30px;
}
.checkbox input[type='checkbox'] {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    opacity: 0;
}
.checkbox label {
    position: absolute;
    left: 30px;
    top: 0;
    height: 20px;
    line-height: 20px;
}
.checkbox label:before {
    content: '';
    position: absolute;
    left: -30px;
    top: 0;
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
}

.checkbox label:after {
    content: '';
    position: absolute;
    left: -22px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: 0;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    background: #fff;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
}
.checkbox input[type='checkbox']:checked + label:before {
    background: #4cd764;
    border-color: #4cd764;
}
.checkbox input[type='checkbox']:checked + label:after {
    background: #4cd764;
}
   .b{
       width: 200px;
       height: 200px;
       background:#000;
       opacity: 0.1;
   }
    .aSpan{
        display: inline-block;
        width: 100px;
        height: 50px;
        pointer-events: none
    }
    </style>
</head>

<body>


    <span class="aSpan">*******************</span>
    <div class="b" id="one"></div>
    <div class='checkbox'>
        <input type='checkbox' id='checkbox1' name='checkboox[]'>
        <label for='checkbox1'>篮球</label>
    </div>
    <div class='checkbox'>
        <input type='checkbox' id='checkbox1' name='checkboox[]'>
        <label for='checkbox1'>篮球</label>
    </div>
    <div class='checkbox'>
        <input type='checkbox' id='checkbox2' name='checkboox[]'>
        <label for='checkbox2'>乒乓球</label>
    </div>
    <div class='checkbox'>
        <input type='checkbox' id='checkbox3' name='checkboox[]' checked>
        <label for='checkbox3'>足球</label>
        <a href="http://es6.ruanyifeng.com/#docs/string">百度</a>
    </div>


    <!-- 控制显示隐藏与冒泡 -->
    <div class="show" style="margin:50px 0"> 显示</div>
    <div class="hidebox" id="test" style="display:none">123313123323213212313231331313</div>
</body>

<script>
    $(function () {
        function stopPropagation(e) {
            if (e.stopPropagation)
                e.stopPropagation();
            else
                e.cancelBubble = true;
        }

        $('.show').click(function (e) {
            stopPropagation(e)
            $('.hidebox').css('display', 'block')
        })
        $(document).click(function () {
            $('.hidebox').css('display', 'none')
        })
    })

</script>
<script>
    var timmerHandle = null;
    var isDrag = false;
    var isClick = false;
    var myChart = $('#one')

    // myChart.on("click", function (param){               
    //     setTimeout(function(){
    //         if(isClick && param.dataType == "node"){
    //             console.log("点击了节点");
    //         }
    //     },500);
    // });
    myChart.on("mousedown", function (param) {
        //因为mouseDownFun每次都会调用的，在这里重新初始化这个变量  
        isDrag = false;
        //延迟100ms  
        timmerHandle = setTimeout(setDragTrue, 500);
    });
    myChart.on("mouseup", function (param) {
        if (!isDrag) {
            //先把doMouseDownTimmer清除，不然200毫秒后setGragTrue方法还是会被调用的  
            clearTimeout(timmerHandle);
            console.log("mouse up.");
            isClick = true;
        } else {
            isDrag = false;
            console.log("draging over.");
            isClick = false;
        }
    });
    function setDragTrue() {
        isDrag = true;
    }

</script>

</html>